import { ApiProperty } from '@nestjs/swagger';
import { IsOptional, IsString, Length, Matches } from 'class-validator';

export class UpdateMeDto {
  @ApiProperty({
    description: '用户显示名称',
    required: false,
  })
  @IsOptional()
  @IsString()
  @Length(1, 64)
  displayName?: string;

  @ApiProperty({
    description: '用户手机号',
    required: false,
  })
  @IsOptional()
  @IsString()
  @Matches(/^1[3-9]\d{9}$/, {
    message: '手机号格式不正确',
  })
  phone?: string;
}
